package net.shopxx.entity;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.OrderBy;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;

/**
 * 实体类 - 旗舰店
 */

@Entity
public class FlagshipStore extends BaseEntity {

	private static final long serialVersionUID = -7519486823153844426L;
	public static final int BANNER_LIST_COUNT = 6;// 特价商品列表最大商品数

	public enum StoreType {
		normal, flagship, saleonly
	};

	private Member member;// 用户
	private String status;// 状态
	private String store_name;
	private String store_banner;
	private String store_logo;

	private StoreType storeType;

	private Set<StoreNavigation> storeNavigationSet;

	@OneToOne(fetch = FetchType.LAZY)
	@JoinColumn(nullable = false)
	public Member getMember() {
		return member;
	}

	public void setMember(Member member) {
		this.member = member;
	}

	@Column(nullable = false)
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getStore_name() {
		return store_name;
	}

	public void setStore_name(String store_name) {
		this.store_name = store_name;
	}

	public String getStore_banner() {
		return store_banner;
	}

	public void setStore_banner(String store_banner) {
		this.store_banner = store_banner;
	}

	public String getStore_logo() {
		return store_logo;
	}

	public void setStore_logo(String store_logo) {
		this.store_logo = store_logo;
	}

	@OneToMany(mappedBy = "flagshipStore", fetch = FetchType.LAZY)
	@Cascade(value = { CascadeType.DELETE })
	@OrderBy("name asc")
	public Set<StoreNavigation> getStoreNavigationSet() {
		return storeNavigationSet;
	}

	public void setStoreNavigationSet(Set<StoreNavigation> storeNavigationSet) {
		this.storeNavigationSet = storeNavigationSet;
	}

	public StoreType getStoreType() {
		return storeType;
	}

	public void setStoreType(StoreType storeType) {
		this.storeType = storeType;
	}

}